package com.sky.wsp.webflux.service;

import com.sky.wsp.webflux.vo.UserVO;
import org.springframework.stereotype.Component;

/**
 * @author wangshaopeng@talkweb.com.cn
 * @desccription 在此输入描述
 * @date 2023/10/24
 */
@Component
public class UserService {

    public UserVO save(UserVO user) {
        System.out.println("save begin...");
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        user.setId(1);
        user.setName("张三");
        user.setAddress("长沙市桐梓坡路999号");
        user.setSalary(3600.00D);
        System.out.println("save end...");
        return user;
    }

    public UserVO findById(Integer id) {
        System.out.println("findById begin...");
        try {
            Thread.sleep(1000L);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        UserVO user = new UserVO();
        user.setId(id);
        user.setName("张三" + id);
        user.setAddress("长沙市桐梓坡路999号" + id);
        user.setSalary(3600.00D);
        System.out.println("findById end...");
        return user;
    }
}
